package com.ftg.learn.bus.sharecaruse_record.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ftg.learn.bus.sharecaruse_record.entity.SharecarUseRecord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SharecarUseRecordMapper extends BaseMapper<SharecarUseRecord> {

    /**
     * 操作自动添加记录
     * @param cid
     * @param name
     * @return
     */
    @Insert("insert into sharecar_use_record (sharecar_use_operate,sharecar_use_operater,sharecar_use_operatedate) values (#{param1},#{param2},NOW());")
    int autoInsert(String cid,String name);

    /**
     * 查全部
     * @return
     */
    @Select("select * from sharecar_use_record")
    List<SharecarUseRecord> showAll();
}
